package com.dashboard.tuyensinh;

import com.lb.jwitter.connectDatabase.ConnectTuyenSinh;
import com.opensymphony.xwork2.Action;

public class TyLeGioiTinhAction {
	private String jsonData;
	public String getJsonData() {
		return jsonData;
	}


	public void setJsonData(String jsonData) {
		this.jsonData = jsonData;
	}
	////////////////////////////////////////////////////////
	private String namHoc;

	public String getNamHoc() {
		return namHoc;
	}


	public void setNamHoc(String namHoc) {
		this.namHoc = namHoc;
	}
	/////////////////////////////////////////////////////////
	
	public String execute() throws Exception
	{
		ConnectTuyenSinh connection= new ConnectTuyenSinh();
		if(connection.getConnection()!=null){
			//namHoc="2014";
			
			if(namHoc==null||namHoc.length()<1){
				return Action.ERROR;
			}
			
			String query="select  sum(tongSo) as tongSo, sum(soSVNu) as soSVNu, sum(tongSo)-sum(soSVNu)  as soSVNam"
					+" from tuyensinh where nam="+namHoc;
			//{"tongSo":"1000","soSVNu":"200","soSVNam":"8000"}
			jsonData=connection.getJSonData(query);
			
			
		}
		connection.closeConnection();
		return Action.SUCCESS;

	}
}
